package com.zy.dp.composite.example5;

import java.util.List;

public abstract class Component
{

	private Component parent = null;

	public Component getParent()
	{
		return parent;
	}

	public void setParent(Component parent)
	{
		this.parent = parent;
	}

	public List<Component> getChildren()
	{
		throw new UnsupportedOperationException("对象不支持这个功能");
	}

	public abstract void printStruct(String preStr);

	public void addChild(Component child)
	{

		throw new UnsupportedOperationException("对象不支持这个功能");

	}

	public void removeChild(Component child)
	{

		throw new UnsupportedOperationException("对象不支持这个功能");

	}

	public Component getChildren(int index)
	{

		throw new UnsupportedOperationException("对象不支持这个功能");

	}

}
